﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace ExamServer.Migrations
{
    public partial class InitialCreate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "QuestionTypes",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TypeName = table.Column<string>(maxLength: 50, nullable: false),
                    TypeState = table.Column<int>(nullable: false),
                    Remark = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_QuestionTypes", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "tbUsers",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    Name = table.Column<string>(maxLength: 20, nullable: false),
                    Password = table.Column<string>(maxLength: 20, nullable: false),
                    Birthday = table.Column<string>(nullable: true),
                    Email = table.Column<string>(nullable: true),
                    Remark = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tbUsers", x => x.Id);
                });

            migrationBuilder.InsertData(
                table: "QuestionTypes",
                columns: new[] { "Id", "Remark", "TypeName", "TypeState" },
                values: new object[,]
                {
                    { 1, "选择题备注", "选择题", 1 },
                    { 2, "填空题备注", "填空题", 2 }
                });

            migrationBuilder.InsertData(
                table: "tbUsers",
                columns: new[] { "Id", "Birthday", "Email", "Name", "Password", "Remark" },
                values: new object[,]
                {
                    { new Guid("a6373585-0cd6-4e62-acac-0749fff8a834"), "1990-01-01", "zhangsan@163.com", "张三", "123456", null },
                    { new Guid("762d363e-79cd-4ef1-b3e0-114e9606f29e"), "1992-01-01", "lisi@qq.com", "李四", "123456", null }
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "QuestionTypes");

            migrationBuilder.DropTable(
                name: "tbUsers");
        }
    }
}
